import request from '@/axios'
import { Menu } from './types'

export const getMenuListApi = (data: object = {}) => {
  return request.post<Menu[]>({ url: '/api/menu/tree-list', data })
}

// 新增
export const saveMenuApi = (data: object = {}) => {
  return request.post<Menu[]>({ url: '/api/menu', data })
}

// 修改
export const updateMenuApi = (data: object = {}) => {
  return request.put<Menu[]>({ url: '/api/menu', data })
}
